<?php

/**
 * BlogComment form.
 *
 * @package    blog
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
abstract class PluginBlogCommentForm extends BaseBlogCommentForm
{
  public function setup()
  {
	  parent::setup();
	   $this->useFields(array('comm', 'article_id', 'user_id' )); 
	   $this->setWidget('article_id', new sfWidgetFormInputHidden());
	   $this->setWidget('user_id', new sfWidgetFormInputHidden());
	   
	   $this->setValidators(array(
       'id'    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'comm' => new sfValidatorString(array('min_length' => 2), array('required' => 'Le titre est obligatoire.')),
      'article_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BlogArticle'))),
      'user_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'))),
    ));
	  
	  
  }
}
